<template>
  <div class="no-data"
       :style="margin">
    <img :src="noData.img"
         :width="noData.width"
         :style="width"
         alt />
    <p :style="txtStyle">
      {{noData.text}}
    </p>
  </div>
</template>

<script>
import Vue from 'vue'
export default Vue.extend({
  props: {
    noData: {
      type: Object,
      default() {
        return { text: '暂无数据', img: 'https://img.wifenxiao.com/h5-wfx/images/user/no_user_data.png', marginTop: '0', width: '29%' }
      }
    }
  },
  computed: {
    margin() {
      return { marginTop: this.noData.marginTop }
    },
    width() {
      return { width: this.noData.width }
    },
    txtStyle() {
      return {
        color: this.noData.txtColor,
        marginTop: this.noData.txtMarginTop
      }
    }
  }
})
</script>

<style lang="scss" >
.no-data {
  padding: 110px 0;
  text-align: center;
  img {
    width: 426px;
  }
  p {
    font-size: 28px;
    color: #999;
    margin-top: -90px;
    letter-spacing: 2px;
  }
}
</style>